package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PictureTextMapper;
import com.ruoyi.system.domain.PictureText;
import com.ruoyi.system.service.IPictureTextService;
import com.ruoyi.common.core.text.Convert;

/**
 * 图文Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-12
 */
@Service
public class PictureTextServiceImpl implements IPictureTextService 
{
    @Autowired
    private PictureTextMapper pictureTextMapper;

    /**
     * 查询图文
     * 
     * @param id 图文主键
     * @return 图文
     */
    @Override
    public PictureText selectPictureTextById(Long id)
    {
        return pictureTextMapper.selectPictureTextById(id);
    }

    /**
     * 查询图文列表
     * 
     * @param pictureText 图文
     * @return 图文
     */
    @Override
    public List<PictureText> selectPictureTextList(PictureText pictureText)
    {
        return pictureTextMapper.selectPictureTextList(pictureText);
    }

    /**
     * 新增图文
     * 
     * @param pictureText 图文
     * @return 结果
     */
    @Override
    public int insertPictureText(PictureText pictureText)
    {
        pictureText.setCreateTime(DateUtils.getNowDate());
        return pictureTextMapper.insertPictureText(pictureText);
    }

    /**
     * 修改图文
     * 
     * @param pictureText 图文
     * @return 结果
     */
    @Override
    public int updatePictureText(PictureText pictureText)
    {
        pictureText.setUpdateTime(DateUtils.getNowDate());
        return pictureTextMapper.updatePictureText(pictureText);
    }

    /**
     * 批量删除图文
     * 
     * @param ids 需要删除的图文主键
     * @return 结果
     */
    @Override
    public int deletePictureTextByIds(String ids)
    {
        return pictureTextMapper.deletePictureTextByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除图文信息
     * 
     * @param id 图文主键
     * @return 结果
     */
    @Override
    public int deletePictureTextById(Long id)
    {
        return pictureTextMapper.deletePictureTextById(id);
    }
}
